//
//  DYShopVC.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/10.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYShopVC.h"
#import "DYItemView.h"
#import "DYBranchListVC.h"
#import "DYEmployeeManagementVC.h"
#import "DYPermissionVC.h"

#import "DYRecordInfoVC.h"//备案信息
#import "DYRechargeRecordVC.h"
#import "DYResultsStatisticsVC.h"//业绩管理
#import "DYRechargeSetVC.h"
#import "DYCardSettingVC.h"

@interface DYShopVC ()

@property (nonatomic,strong)DYItemView *shopView;

@property (nonatomic,strong)DYItemView *cardView;

@property (nonatomic,strong)DYItemView *financeView;

@end

@implementation DYShopVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title=@"商铺管理";
}
-(void)dy_initUI
{
    [super dy_initUI];
    
    [self.tableView addSubview:self.shopView];
    [self.tableView addSubview:self.cardView];
    [self.tableView addSubview:self.financeView];
}
-(DYItemView *)shopView
{
    if (!_shopView) {
        _shopView=[[DYItemView alloc]initWithFrame:CGRectMake(0, BILIHEIGHT(10), kScreenWidth, BILIHEIGHT(130))];
        _shopView.title=@"店铺管理";
        _shopView.dataArray=@[@{@"title":@"分店管理",@"image":@"ic_fd"},
                              @{@"title":@"员工管理",@"image":@"ic_employee"},
                              @{@"title":@"权限管理",@"image":@"ic_jurisdiction"}
                              ];
        
        @weakify(self);
        _shopView.itemBlock = ^(NSInteger index) {
            @strongify(self);
            if (index==1) {
                DYBranchListVC *vc=[[DYBranchListVC alloc]init];
                [self.navigationController pushViewController:vc animated:YES];
            }else if (index==2){
                DYEmployeeManagementVC *vc=[[DYEmployeeManagementVC alloc]init];
                [self.navigationController pushViewController:vc animated:YES];
            }else{
                DYPermissionVC *vc=[[DYPermissionVC alloc]init];
                [self.navigationController pushViewController:vc animated:YES];
            }
        };
    }
    return _shopView;
}
-(DYItemView *)cardView
{
    if (!_cardView) {
        _cardView=[[DYItemView alloc]initWithFrame:CGRectMake(0, BILIHEIGHT(10)+self.shopView.xhq_bottom, kScreenWidth, BILIHEIGHT(130))];
        _cardView.title=@"发卡管理";
        _cardView.dataArray=@[@{@"title":@"卡点设置",@"image":@"ic_faka"},
                              @{@"title":@"充值设置",@"image":@"ic_czhisz"},
                              @{@"title":@"备案信息",@"image":@"ic_beian"}
                              ];
        
        @weakify(self);
        _cardView.itemBlock = ^(NSInteger index) {
            @strongify(self);
            if (index==1) {
                DYCardSettingVC *vc=[[DYCardSettingVC alloc]init];
                [self.navigationController pushViewController:vc animated:YES];
            }else if (index==2){
                DYRechargeSetVC *vc=[[DYRechargeSetVC alloc]init];
                [self.navigationController pushViewController:vc animated:YES];
            }else{
                DYRecordInfoVC *vc=[[DYRecordInfoVC alloc]init];
                [self.navigationController pushViewController:vc animated:YES];
            }
        };
    }
    return _cardView;
}
-(DYItemView *)financeView
{
    if (!_financeView) {
        _financeView=[[DYItemView alloc]initWithFrame:CGRectMake(0, BILIHEIGHT(10)+self.cardView.xhq_bottom, kScreenWidth, BILIHEIGHT(130))];
        _financeView.title=@"财务管理";
        _financeView.dataArray=@[@{@"title":@"充值记录",@"image":@"ic_paylist"},
                              @{@"title":@"收款记录",@"image":@"ic_costlist"},
                              @{@"title":@"业绩统计",@"image":@"ic_yjitongj"}
                              ];
        
        @weakify(self);
        _financeView.itemBlock = ^(NSInteger index) {
            @strongify(self);
            if (index==1) {
                DYRechargeRecordVC *vc=[[DYRechargeRecordVC alloc]init];
                vc.type=0;
                [self.navigationController pushViewController:vc animated:YES];
            }else if (index==2){
                DYRechargeRecordVC *vc=[[DYRechargeRecordVC alloc]init];
                vc.type=1;
                [self.navigationController pushViewController:vc animated:YES];
            }else{
                DYResultsStatisticsVC *vc=[[DYResultsStatisticsVC alloc]init];
                [self.navigationController pushViewController:vc animated:YES];
            }
        };
    }
    return _financeView;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
